﻿var status = -1;

function action(mode, type, selection) {
    if (mode == 1) {
        status++;
    } else {
        if (status == 0) {
            cm.dispose();
        }
        status--;
    }
    if (status == 0) {
        if ((cm.getSpace(1) > 1||cm.getSpace(2) > 1||cm.getSpace(3) > 1||cm.getSpace(4) > 1)&&cm.getHyPay(3) >= 5000 && cm.getPlayer().getCSPoints(1) >= 500000) {
            cm.sendYesNo("这里是充值抽奖专区。我背包里面包含了暴君 超越证明（全属性100） 图腾套装 极品戒指 极品饰品 最高级贝勒德 坚韧意志黑色等所有装备哦.如果你充值满了5000可以再这里花费50W点卷抽奖一次哦！你确定要抽奖吗？注：获得高级装备几率提高10倍。");
        } else {
            cm.sendOk("我背包里面包含了暴君 超越证明（全属性100） 图腾套装 极品戒指 极品饰品 最高级贝勒德 坚韧意志黑色等装备哦。如果你累计金额满了5000可以再这里花费50万点卷抽奖一次哦！你的充值金额到5000或足够50万点卷了吗？");
            cm.safeDispose();
        }
    } else if (status == 1) {
            var item;
            var chance = Math.floor(Math.random() * 165);
			if(chance >= 0 && chance <= 50){
                var itemList = new Array(
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124

                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
           } else if (chance >= 51 && chance <= 1000) {
                var itemList = new Array(
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
            } else if (chance >= 101 && chance <= 130) {
                var itemList = new Array(
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
            } else if (chance >= 131 && chance <= 150) {
                var itemList = new Array(
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
            } else if (chance >= 151 && chance <= 160) {
                var itemList = new Array(2040303, //耳环智力必成卷
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124
                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
            } else {
 		var itemList = new Array(
1032201,
1122259,
1012414,
1022195,
1202173,
1202174,
1202175,
1113069,
1112919,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112659,
1112429,
1112428,
1202173,
1202174,
1202175,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1032219,
1113020,
1113084,
1132215,
1152124,
1113069,
1112919,
1112659,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,     
1113056,
1132246,       
1122267,   
1032223,      
1113075,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132174,
1102481,
1082543,
1072743,
1132175,
1102482,
1082544,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1072744,
1132176,
1102483,
1082545,
1072745,
1132177,
1102484,
1082546,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124,
1132215,
1152124,
1072746,
1132178,
1102485,
1082547,
1072747,
1202173,
1202174,
1202175,
1113069,
1112919,
1112659,
1112429,
1112428,
1112427,
1112428,
1032219,
1113020,
1113084,
1132215,
1152124
		    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(5000)");
	    }
            if (item != -1) {
		cm.gainNX( -500000);
                cm.sendOk("你获得了 #b#t" + item + "##k.");
		cm.dispose();
            } else {
                cm.sendOk("你确实累计金额到5000了吗或足够50万点卷?如果是,请你确认在背包的装备,消耗,其他窗口中是否有一格以上的空间?");
		cm.dispose();
            }
        } else {
            cm.sendOk("出现错误 或 您取消");
		cm.dispose();
}
}
